package hn.sigit.model.ladm.spatialunit.dao;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;

import hn.sigit.model.ladm.spatialunit.LA_SpatialUnit;
import hn.sigit.model.util.SigitDAO;

public class LA_SpatialUnitDAO extends SigitDAO<LA_SpatialUnit> {
	private static final long serialVersionUID = 1L;

	public static LA_SpatialUnit loadSpatialUnitById(long spatialUnitId) {
		return loadSpatialUnitById(getSession(), spatialUnitId);
	}
	
	public static LA_SpatialUnit loadSpatialUnitById(Session session, long spatialUnitId) {
		Criteria criteria = session.createCriteria(LA_SpatialUnit.class);
		criteria.add(Restrictions.eq("", spatialUnitId));
		
		return (LA_SpatialUnit) criteria.uniqueResult();
	}
}
